function validateEmailField(email){
    var x=document.getElementById("email").value;
    var atpos=x.indexOf("@");
    var dotpos=x.lastIndexOf(".");
    if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
    {
        errorPopup("Not a valid e-mail address");
        return false;
    }

    if(email==x) //If the old email is equal to the current then perform no check for uniqueness. On the server side the email portion will be ignored.
        return true;

    return isEmailUnique(); // return true if the email is unique
}